<?php

namespace Schedule\Model;

use Think\Model\RelationModel;

class CompanyUserModel extends RelationModel {

    //定义主表
    protected $tableName = 'company_user';
    //定义关联关系
    protected $_link = array(
        'info' => array(
            'mapping_type' => self::HAS_ONE,
            'mapping_name' => 'info',
            'class_name' => 'company_user_info',
            'foreign_key' => 'user_id',
        ),
        'exp' => array(
            'mapping_type' => self::HAS_MANY,
            'mapping_name' => 'exp',
            'class_name' => 'company_experience',
            'foreign_key' => 'user_id',
        ),
         'test' => array(
            'mapping_type' => self::HAS_MANY,
            'mapping_name' => 'test',
            'class_name' => 'company_test',
            'foreign_key' => 'user_id',
        ),
         'ach' => array(
            'mapping_type' => self::HAS_MANY,
            'mapping_name' => 'ach',
            'class_name' => 'company_achievement',
            'foreign_key' => 'user_id',
        ),
          'subj' => array(
            'mapping_type' => self::HAS_MANY,
            'mapping_name' => 'subj',
            'class_name' => 'company_teach_subject',
            'foreign_key' => 'user_id',
        )
    );

}
